package com.cskaoyan.controller.wx.sl;

import com.cskaoyan.service.wx.sl.WxSearchService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.sl.WxSearchIndexVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class WxSearchController {

    @Autowired
    WxSearchService searchService;

    //显示搜索时的默认信息
    @RequestMapping("wx/search/index")
    public BaseRespVo searchIndex(){
        WxSearchIndexVo wxSearchIndexVo = searchService.searchIndex();
        return BaseRespVo.ok(wxSearchIndexVo);
    }
    //搜索帮助
    @RequestMapping("wx/search/helper")
    public BaseRespVo searchHelper(String keyword){
        List searchHelperVo = searchService.searchHelper(keyword);
        return BaseRespVo.ok(searchHelperVo);
    }
    //搜索历史记录
    @RequestMapping("wx/search/clearhistory")
    public BaseRespVo searchClearhistory(){
        int ant = searchService.searchClearhistory();
        return BaseRespVo.ok();
    }
}
